/* eslint-disable no-use-before-define */
import React from 'react'
import { noop } from 'lodash'
import { ReactSortable as SorterBox } from 'react-sortablejs'

export function CardGroup({
  dataSource, setDataSource, animation, children, ...rest
}) {
  return (
    <SorterBox
      list={dataSource}
      setList={setDataSource}
      animation={animation}
      {...rest}
    >
      {children}
    </SorterBox>
  )
}

CardGroup.defaultProps = {
  group: '',
  dataSource: [],
  onChange: noop,
  animation: 200,
}
